
find_package(GTest REQUIRED)
include(GoogleTest)

aux_source_directory(. TEST_SRC)
add_subdirectory(test_libevent)

foreach (FILE_PATH ${TEST_SRC})
    string(REGEX REPLACE ".+/(.+)\\..*" "\\1" FILE_NAME ${FILE_PATH})
    if (${FILE_NAME} MATCHES "^test_")
        add_executable(${FILE_NAME} ${FILE_PATH})
        target_link_libraries(
            ${FILE_NAME}
            PRIVATE GTest::gtest_main
            PRIVATE ZeDisk
        )
    endif ()
endforeach ()
